{detail_table flow='sale' from=$rs.detail action=['view','edit'] op_show=['add','edit'] 
	thead=[$lang.product_no,$lang.product_name,'flow_color','flow_size','flow_quantity','flow_capability','flow_dozen','flow_mantissa','flow_row_total','flow_return_warehouse',$lang.price,$lang.money,'flow_sale_discount','flow_sale_after_discount',$lang.is_use,$lang.comments]}
<tr index="{$index}" class="{$none}">
	<input type="hidden" name="detail[{$index}][id]" value="{$item.id}">
	{td id="span_product" class="t_left" view="product_no" width="110" tfoot_value="{$rs.detail_total.total_product}"}
		<input type="hidden" name="detail[{$index}][product_id]" value="{$item.product_id}" onchange="{if C('product_color')==1}$.colorEnabled(this);{/if}{if C('product_size')==1}$.sizeEnabled(this);{/if} " jqproc class="w80">
		<input type="text" name="temp[{$index}][product_no]" value="{$item.product_no}" url="{'AutoComplete/product'|U}"  jqac class="w80">
	{/td}
	<td id="span_product_name" width="110" class="t_left">
	{$item.product_name}
	</td>
	{td type="flow_color" view="color_name" width="56"}
		<input type="hidden" name="detail[{$index}][color_id]" value="{$item.color_id}">
		<input type="text" name="color_name" value="{$item.color_name}" url="{'AutoComplete/color'|U}" {if C('product_color')==1 && $rs}where="{"id in(select color_id from product_color where product_id={$item.product_id})"|urlencode}" jqac  class="w40" {elseif C('product_color')==1}disabled class="disabled w50"{elseif C('PRODUCT_FACTORY')!=10}jqac{/if}>
	{/td}
	{td type="flow_size" view="size_name" width="46"}
		<input type="hidden" name="detail[{$index}][size_id]" value="{$item.size_id}">
		<input type="text" name="size_name" value="{$item.size_name}" class="w40" url="{'AutoComplete/size'|U}" {if C('product_size')==1 && $rs}where="{"id in(select size_id from product_size where product_id={$item.product_id})"|urlencode}" jqac {elseif C('product_size')==1}disabled class="disabled w40"{elseif C('PRODUCT_FACTORY')!=1}jqac{/if}>
	{/td}
	{td type="flow_quantity" view="edml_quantity"  tfoot=[total_quantity=>""]  width="46" tfoot_value=$rs.detail_total.dml_quantity  class="t_right"}
		<input type="text" name="detail[{$index}][quantity]"   class="w40" value="{$item.edml_quantity}" row_total>
	{/td}
	{td type="flow_capability" view="edml_capability" width="50"  class="t_right"}
		<input type="text" name="detail[{$index}][capability]"  class="w40"  value="{$item.edml_capability}" row_total>
	{/td}
	{td type="flow_dozen" view="edml_dozen" width="50"}
		<input type="text" name="detail[{$index}][dozen]"  class="w40"   value="{$item.edml_dozen}" row_total>	{/td}
		
	{td type="flow_mantissa" view="dd_mantissa"  width="35"}
		<input type="hidden" value="{$item.mantissa|default:1}" name="detail[{$index}][mantissa]" >
		<input type="checkbox" name="tmp_mantissa" {if $item.mantissa==2}checked{/if} onclick="$.setQuantityState(this);">
	{/td}
	
	{td  type="flow_row_total" width="40" view="edml_sum_quantity"  total_row_qn="" tfoot=['total_col_qn'=>''] tfoot_value=$rs.detail_total.dml_sum_quantity class="t_right"}
		{$item.edml_sum_quantity}
	{/td}
	{td type="flow_return_warehouse"  view="w_name" width="110"}
		{warehouse   hidden=["name"=>"detail[`$index`][warehouse_id]",'value'=>$item.warehouse_id] value=$item.w_name  name="warehouse_name"  }
	{/td}
	{td view="dml_price" width="46" class="t_right"}
		<input type="text" name="detail[{$index}][price]"  class="w40" value="{$item.edml_price}" row_total_money>
	{/td}
	{td width="70" total_row_money="" tfoot=['total_col_money'=>''] tfoot_value=$rs.detail_total.dml_money class="t_right"}
		{$item.dml_money}
	{/td}
	{td view="dml_discount" type='flow_sale_discount' class="t_right" width="30"}
		<input type="text" name="detail[{$index}][discount]" value="{$item.edml_discount}" style="width:24px;"  row_total_disount>%
	{/td}
	{td tfoot=[total_col_dis_money=>""] total_row_dis_money="" type='flow_sale_after_discount' tfoot_value=$rs.detail_total.dml_discount_money class="t_right"}
	{$item.dml_discount_money}
	{/td}
	{td view="dd_is_use" width="26"}
	<input type="hidden" name="detail[{$index}][is_use]" value="{$item.is_use|default:1}">
	<input type="checkbox" name="tmp[{$index}][is_use]" {if $item.is_use!=2}checked{/if} onclick="$.setIsUse(this)">
	{/td}
	{td view="detail_comments" width="76"}
	<input type="text" name="detail[{$index}][detail_comments]" value="{$item.detail_comments}" style="text-align:left;width:70px;">
	{/td}
	{detail_operation}
</tr>
{/detail_table}
